﻿using SanJ.FreeCare.Abp.Authorization.Users;
using System;
using System.Collections.Generic;
using System.Linq;

namespace SanJ.FreeCare.Notifications
{
    /// <summary>
    /// Represents a notification sent to a user.
    /// </summary>
    [Serializable]
    public class UserNotification : IUserIdentifier
    {
        public Guid Id { get; set; }
        /// <summary>
        /// TenantId.
        /// </summary>
        public Guid? TenantId { get; set; }

        /// <summary>
        /// User Id.
        /// </summary>
        public Guid UserId { get; set; }

        /// <summary>
        /// Current state of the user notification.
        /// </summary>
        public UserNotificationState State { get; set; }

        /// <summary>
        /// The notification.
        /// </summary>
        public TenantNotification Notification { get; set; }

        /// <summary>
        /// which realtime notifiers should handle this notification
        /// </summary>
        public string TargetNotifiers { get; set; }

        public List<string> TargetNotifiersList => TargetNotifiers.IsNullOrWhiteSpace()
            ? new List<string>()
            //: TargetNotifiers.Split(NotificationInfo.NotificationTargetSeparator).ToList();
            : TargetNotifiers.Split(",").ToList();


    }
}